Create Customer Product

This API is used to create a product in the catalog. Later on, it may be attached (allocated) to the customer children (sub-customers).

HTTP URL

 

POST /api/v2/customer/{id}/product

Eligibility

The Requestor is eligible to create a new product for his sub-customers’ use. It is not eligible to create a new product for its own profile use.

API Request

Request Structure

Parameter

Type

M/O/CM

Description

name

String

M

Product name. Must be unique.

description

String

O

Product description

cost

Decimal

M

Cost of the product. May contain a decimal value. If no cost should be applied, send ‘0’.

currency

String

M

Cost currency, e.g., USD, GBP, EUR

renewalInterval

String

M

Renewal period interval. ENUM valid values: DAILY, WEEKLY, MONTHLY, QUARTERLY, SEMI_ANNUALLY, ANNUALLY, ONE_TIME

renewalIntervalMethod

String

O

Determines how to set the renewal day.

ENUM valid values:

FIRST_DAY – Renewal day will be the first day of the renewal interval. E.g., 1’st of the month per ‘MONTHLY’ interval.

SELF_DEFINED – Renewal day will be the day defined by the user. E.g., 10’th of the month per ‘MONTHLY’ interval.

PRODUCT_ALLOCATION – Renewal day will be set based on the actual product attachment (allocated) day.

Default if not set: FIRST_DAY (ONE_TIME exclusive)

renewalIntervalDay

Numeric

CM

Determines the requested day of the selected period.

ENUM Valid values:

DAILY: N/A

WEEKLY: 1–7

MONTHLY: 1–28

QUARTERLY: 1–90

SEMI_ANNUALLY: 1–180

ANNUALLY: 1–365

ONE_TIME: N/A

Mandatory only if SELF_DEFINED was chosen per ‘renewalIntervalMethod’ attribute.

expirationType

String

O

Determines how to set the expiration date.

ENUM valid values:

FIXED – Fixed predefined expiration date.

RELATIVE_ATTACHED – Time duration starting the time the product was attached (allocated) to the child customer. E.g., 10 days from product attachment to the child customer.

If not sent, the product will not expire at all.

expirationDate

Date

CM

Determines the requested date per chosen ‘expirationType’.

Mandatory only if selected ‘expirationType’ is FIXED.

If populated for other expiration types or no selection, it is ignored.

expirationUnit

String

CM

Determines the time unit that should be used for expiration calculation.

ENUM Valid values: DAY, WEEK, MONTH, YEAR

Mandatory only if selected ‘expirationType’ differs from FIXED.

If populated for FIXED or no ‘expirationType’, it is ignored.

expirationValue

Numeric

CM

Determines the requested time value per chosen ‘expirationUnit’.

Mandatory only if selected ‘expirationType’ differs from FIXED.

If populated for FIXED or no ‘expirationType’, it is ignored.

API Response

Response Structure

Parameter

Type

M/O/CM

Description

errorCode

String

O

Failure code. See list below, under ‘Error Codes’ section.

errorMessage

String

O

Failure detailed description. See list below, under ‘Error Codes’ section.

content

Object

O

Array of main response body object displayed when an API call was successful. For a failure, it will be empty.

pageable

Object

O

Paging information object displayed when an API call was successful. For a failure, it will be empty.

Content data objects

Element

Type

M/O/CM

Description

productId

UUID

M

New product generated universally unique identifier

requestId

UUID

M

Request instance ID. To be used by external systems to query the call (operation) status, whether in progress, successful or failed.

Pageable data objects

Element

Type

M/O/CM

Description

page

Numeric

M

Page number

size

Numeric

M

Page size. Number of requested elements per page

totalPages

Numeric

M

Total amount of available pages per requested page size

totalElements

Numeric

M

Total amount of retrieved elements

Error Codes

In addition to the general success and failure codes, the following error codes are possible.

Code

Message

GLOBAL_1001

Service unavailable. Please try again

Examples

Request Body

Copy
{
  "name": "APN",
  "description": "APN product description",
  "cost": 20.5,
  "currency": "USD",
  "renewalInterval": "MONTHLY",
  "renewalIntervalMethod": "FIRST_DAY",
  "renewalIntervalDay": "",
  "expirationType": "FIXED",
  "expirationDate": "09092023",
  "expirationUnit": "",
  "expirationValue": ""
}

Response Body: Success ACK

Copy
{
  "errorCode": "",
  "errorMessage": "",
  "content": [
    {
      "requestId": "ff74dca6-8e7f-4b85-a42b-13860913b370",
      "productId": "ee74dcd7-8e7f-4c45-a42b-13860913b129"
    }
  ],
  "pageable": {
    "page": 0,
    "size": 10,
    "totalPages": 1,
    "totalElements": 1
  }
}

Response Body: Failure NAK

Copy
{
  "errorCode": "GLOBAL_1001",
  "errorMessage": "Service unavailable. Please try again",
  "content": "",
  "pageable": ""
}